﻿<%@ Page Language="C#" MasterPageFile="~/BasicBase/BasicBase.master" AutoEventWireup="true"
    CodeFile="SearchKeyUnit.aspx.cs" Inherits="BasicBase_KeyUnit_SearchKeyUnit" Title="无标题页"
    StylesheetTheme="Content" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <ul class="topmenu" runat="server" id="menu">
        <li>单位名称：<asp:TextBox ID="txtUnitName" runat="server"></asp:TextBox></li>
        <li>
            <asp:UpdatePanel runat="server" ID="UpdatePanel1">
                <ContentTemplate>
                    辖区单位：<asp:DropDownList ID="DepartmentList" runat="server" AutoPostBack="True" DataTextField="ShortName"
                        DataValueField="DepartmentID" OnTextChanged="DepartmentList_TextChanged" AppendDataBoundItems="True">
                        <asp:ListItem Value="" Text="--单位--"></asp:ListItem>
                    </asp:DropDownList>
                    <asp:DropDownList ID="UnitList" runat="server" DataTextField="ShortName" DataValueField="DepartmentID"
                        AppendDataBoundItems="True">
                    </asp:DropDownList>
                </ContentTemplate>
            </asp:UpdatePanel>
        </li>
        <li>
            <asp:LinkButton ID="btnSubmit" runat="server" Text="搜索" OnClick="btnSubmit_Click" /></li>
    </ul>
    <%--<asp:UpdatePanel ID="upBind" runat="server">
        <ContentTemplate>--%>
    <asp:Label ID="lblInfo" runat="server" ForeColor="#FF8000"></asp:Label>
    <asp:GridView ID="gvKeyUnits" runat="server" AutoGenerateColumns="False" DataKeyNames="KeyUnitID"
        Caption="<span>重点单位列表</span>" OnRowDataBound="gvKeyUnits_RowDataBound" OnRowCommand="gvKeyUnits_RowCommand">
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblID"></asp:Label>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" />
                <HeaderStyle Width="5%" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="重点单位名称" ItemStyle-Width="40%">
                <ItemTemplate>
                    <%#Eval("UnitName")%><br />
                    详细地址：<%#Eval("Address")%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="辖区中队">
                <ItemTemplate>
                    <%# getDepartmentName(Eval("DepartmentId"))%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="消防力量">
                <ItemTemplate>
                    <asp:HyperLink ID="hlFroce" runat="server" NavigateUrl='<%#"FireForce.aspx?uid="+Eval("KeyUnitID").ToString() %>'
                        Text="消防力量"></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="消防设施">
                <ItemTemplate>
                    <asp:HyperLink ID="hlSystem" runat="server" NavigateUrl='<%# "Service.aspx?uid="+Eval("KeyUnitID").ToString() %>'
                        Text="消防设施"></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="重点部位">
                <ItemTemplate>
                    <asp:HyperLink ID="hlPoint" runat="server" NavigateUrl='<%# "KeyPoint.aspx?uid="+Eval("KeyUnitID").ToString() %>'
                        Text="重点部位"></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <a href='<%# Eval("KeyUnitID", "KeyUnitView.aspx?ID={0}") %>'>
                        <img src="../../Images/Report.gif" border="0" alt="报表"></a> <a href='<%# Eval("KeyUnitID", "UpdateKeyUnit.aspx?ID={0}") %>'>
                            <img src="../../Images/Edit.gif" border="0" alt="编辑记录"></a>
                    <asp:ImageButton runat="server" ID="Del" CommandArgument='<%# Eval("KeyUnitID") %>'
                        CommandName="Del" ImageUrl="~/Images/delete.gif"></asp:ImageButton>
                </ItemTemplate>
                <HeaderStyle Width="42px" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
        </Columns>
        <RowStyle HorizontalAlign="Left" />
        <HeaderStyle HorizontalAlign="Left" />
    </asp:GridView>
    <asp:Panel Width="100%" runat="server" ID="panPage" Visible="false">
        <div style="padding: 4px;">
            <div style="float: left">
                <asp:Label ID="lbGridInfo" runat="server"></asp:Label>
            </div>
            <div style="float: right">
                <asp:LinkButton ID="btnFirst" runat="server" CommandArgument="First" CommandName="Page"
                    OnClick="btnFirst_Click">首页</asp:LinkButton>
                <asp:LinkButton ID="btnPrev" runat="server" CommandArgument="Prev" CommandName="Page"
                    OnClick="btnPrev_Click">上一页</asp:LinkButton>
                <asp:LinkButton ID="btnNext" runat="server" CommandArgument="Next" CommandName="Page"
                    OnClick="btnNext_Click">下一页</asp:LinkButton>
                <asp:LinkButton ID="btnLast" runat="server" CommandArgument="Last" CommandName="Page"
                    OnClick="btnLast_Click">末页</asp:LinkButton>
                转到：第
                <asp:DropDownList ID="JumpList" runat="server" AutoPostBack="True" OnSelectedIndexChanged="JumpList_SelectedIndexChanged">
                </asp:DropDownList>
                页
            </div>
        </div>
    </asp:Panel>
    <%--</ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSubmit" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>--%>
</asp:Content>
